﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Mpi.Common;
using System.Diagnostics;

namespace XemlTest
{
    [TestClass]
    public class UtGeneralOntologyHandler
    {
        [TestMethod]
        public void TestMethod1()
        {
            SimpleOboReader sor = new SimpleOboReader();
            sor.Open(@"c:\Users\Billiau\Downloads\XEO.obo");
            sor.NewStanza += NewStanza;
            sor.NewTagValuePair += NewTagValuePair;

            sor.Read();
        }

        private void NewStanza(Object sender, NewStanzaEventArgs e)
        {

        }

        private void NewTagValuePair(Object sender, NewAttributeEventArgs e)
        {

        }

        /// <summary>
        /// this test was created by jahu
        /// </summary>
        [TestCategory("Nightly"), TestCategory("Weekly"), TestCategory("ShoppingCart"), TestMethod()]
        public void LoadPlantOntology()
        {
            LoadOntology(@"c:\Users\Billiau\Downloads\XEO.obo");
        }

        /// <summary>
        /// this test was created by jahu
        /// </summary>
        //[TestCategory("Nightly"), TestCategory("Weekly"), TestCategory("ShoppingCart"), TestMethod()]
        //public void LoadEnvironmentOntology()
        //{
        //    LoadOntology(@"D:\jahu\Visual Studio 2010\Xeml\XEML\EnvironmentOntology_v1_6.obo");
        //}

        private void LoadOntology(string filename)
        {
            Xeml.Document.Ontologies.Environment.GeneralOntologyHandler oh = new Xeml.Document.Ontologies.Environment.GeneralOntologyHandler("jahu", filename);
            oh.Load(string.Empty);
            Debug.Assert(oh.OntologyLoadState == Xeml.Document.Contracts.OntologyLoadState.Loaded);
        }
    }
}
